<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<!--v-for和v-if不能混用 v-for执行顺序会优于v-if执行 -->
<body>
    <div id="app">
        
        <!-- <div v-for="item of arr" :key="item" v-if="item==1">{{item}}</div> -->

        <!-- <div v-for="item of arr" :key="item">
            <div v-if="item==1">{{item}}</div>
            <template v-if="item==1">{{item}}</template>
        </div> -->

        
        <template v-if="isShow">
            <div v-for="item of arr" :key="item">{{item}}</div>
        </template>

    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                arr:[1,2,3],
                isShow:true
            }
        })
    </script>
</body>
</html>